package config

import "time"

const (
	SUCCESS = 200
	ERROR   = 500

	// LoginFail 用户信息板块
	LoginFail = 3003 // 登录失败,密码或用户名不正确

	// ErrorUserNotExist token板块
	ErrorUserNotExist   = 1003
	ErrorTokenExist     = 1004
	ErrorTokenRuntime   = 1005
	ErrorTokenWrong     = 1006
	ErrorTokenTypeWrong = 1007
	ErrorUserNoRight    = 1008
)

var codeMsg = map[int]string{
	SUCCESS: "请求成功",
	ERROR:   "请求失败",

	LoginFail: "登录失败,密码或用户名不正确",

	ErrorUserNotExist:   "用户不存在",
	ErrorTokenExist:     "TOKEN不存在,请重新登陆",
	ErrorTokenRuntime:   "TOKEN已过期,请重新登陆",
	ErrorTokenWrong:     "TOKEN不正确,请重新登陆",
	ErrorTokenTypeWrong: "TOKEN格式错误,请重新登陆",
	ErrorUserNoRight:    "该用户无权限",
}

const (
	ResStatus = "status"
	ResMsg    = "msg"
	ResCode   = "code"
	ResData   = "data"
)

func GetErrMsg(code int) string {
	return codeMsg[code]
}

var MySecret = []byte("今天是个好天气啊") // token 加盐
var ExpireTime = 12 * time.Hour   //  token 过期时间
